<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<title>title</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script type="text/javascript">
	function checkValue() {
		var title=document.getElementById("board_title").value;
		var content=document.getElementById("board_content").value;
		
		if(title==""){
			alert("제목을 입력하세요.");
			return false;
		}else if(content==""){
			alert("내용을 입력하세요.");
			return false;
		}
		document.writeForm.submit();
	}
	
	function cancelWriting() {
		if(confirm("취소하시겠습니까?"))
			history.back();
	}
</script>
</head>

<body>
<c:import url="../common/top.jsp"></c:import>
<div class="container" style="margin: 60px;"></div>

<div class="container">
<div class="row">
<div class="col-sm-1 col-md-1 col-lg-1"></div>
<!--  -->


<div class="col-sm-10 col-md-10 col-lg-10">
	<c:if test="${ sessionScope.userVo!=null }">
	<div class="col-xs-12 col-sm-12 col-md-12- col-lg-12">
		<div class="jumbotron">
			<strong>자유게시판 글쓰기</strong>
		</div>
	</div>
	  
	<div class="col-xs-12 col-sm-12 col-md-12- col-lg-12">
		<form class="form" action="/OffTheRecord/writeBoard.action" name="writeForm" method="post" enctype="multipart/form-data" onsubmit="checkValue();retrun false;">
			제목<input type="text" class="form-control" name="board_title" id="board_title"><p><p>
			내용<textarea rows="15" class="form-control" cols="40" name="board_content" id="board_content"></textarea><p>
			파일 업로드<input type="file" name="uploadFile" class="form-control" class="btn btn-default btn-sm"><p>
			
			<div align="center"><br>
				<input type="submit" value="확인"  class="btn btn-default btn-sm">
				<input type="reset" value="취소" onclick="cancelWriting()" class="btn btn-default btn-sm">
			</div>
		</form>
	</div>
	
	</c:if>
	<div class="">
	
	</div>
</div>

<!--  -->
<div class="col-sm-1 col-md-1 col-lg-1"></div>
</div><!-- row -->
</div><!-- container -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> 
</body>
</html>